<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Yaf_View_Interface class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="yaf-controller-abstract.getcontrollername.html">« Yaf_Action_Abstract::getControllerName</a></li>
      <li style="float: right;"><a href="yaf-view-interface.assign.html">Yaf_View_Interface::assign »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.yaf.html">Yaf</a></li>
    <li>The Yaf_View_Interface class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.yaf-view-interface" class="reference">

 <h1 class="title">The Yaf_View_Interface class</h1>
 

 <div class="partintro"><p class="verinfo">(Yaf &gt;=1.0.0)</p>


  <div class="section" id="yaf-view-interface.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    Yaf给用户提供一个了一个可扩展的、可自定的视图引擎接口，用户可以使用自己的视图引擎来代替Yaf内置的<span class="classname"><a href="class.yaf-view-simple.html" class="classname">Yaf_View_Simple</a></span>。下面是一个关于怎么实现的例子，请看<span class="methodname"><a href="yaf-dispatcher.setview.html" class="methodname">Yaf_Dispatcher::setView()</a></span>。
   </p>
  </div>


  <div class="section" id="yaf-view-interface.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">Yaf_View_Interface</strong>
     </span>
     {</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><a href="yaf-view-interface.assign.html" class="methodname">assign</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code><span class="initializer"> = ?</span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><a href="yaf-view-interface.display.html" class="methodname">display</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$tpl</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$tpl_vars</code><span class="initializer"> = ?</span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><a href="yaf-view-interface.getscriptpath.html" class="methodname">getScriptPath</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><a href="yaf-view-interface.render.html" class="methodname">render</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$tpl</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$tpl_vars</code><span class="initializer"> = ?</span></span>): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><a href="yaf-view-interface.setscriptpath.html" class="methodname">setScriptPath</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$template_dir</code></span>): <span class="type"><span class="type void">void</span></span></div>

   }</div>


  </div>

 </div>

 




































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="yaf-view-interface.assign.html">Yaf_View_Interface::assign</a> — 为视图引擎分配一个模板变量</li><li><a href="yaf-view-interface.display.html">Yaf_View_Interface::display</a> — 渲染一个视图模板, 并直接输出给请求端</li><li><a href="yaf-view-interface.getscriptpath.html">Yaf_View_Interface::getScriptPath</a> — The getScriptPath purpose</li><li><a href="yaf-view-interface.render.html">Yaf_View_Interface::render</a> — 渲染一个视图模板</li><li><a href="yaf-view-interface.setscriptpath.html">Yaf_View_Interface::setScriptPath</a> — The setScriptPath purpose</li></ul>
</div>
</div></div></body></html>